package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.flow;

import com.glsc.ngateway.common.base.domain.mysql.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author xuchang
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Entity
@Where(clause = "deleted = 0")
@SQLDelete(sql = "update t_gw_flow_form_equipment_offline_server_detail set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@SQLDeleteAll(sql = "update t_gw_flow_form_equipment_offline_server_detail set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@Table(name = "t_gw_flow_form_equipment_offline_server_detail")
@org.hibernate.annotations.Table(appliesTo = "t_gw_flow_form_equipment_offline_server_detail", comment = "设备下架流程form表单-服务器子表")
public class FlowFormEquipmentOfflineServerDetail extends BaseEntity {

    private static final long serialVersionUID = -5629503609636373081L;

    @Column(name = "equipment_offline_id", columnDefinition = "bigint not null comment '主表ID'")
    private Long equipmentOfflineId;

    @Column(name = "server_dev_id", columnDefinition = "int comment '服务器id'")
    private Integer serverDevId;

    @Column(name = "ip2", columnDefinition = "varchar(32) comment '服务器ip2'")
    private String ip2;

    @Column(name = "offline_reason", columnDefinition = "text comment '下架原因'")
    private String offlineReason;

}
